package draw.impl;

/**
 * Contains information about a path. A path is simply a container
 * that indicates through a function where a point lies with respect
 * to time. A path has a start and an ending point.
 *
 * @author Matthew B. Gray
 * @version 1.0
 */
public class Path {
	private Point start, finish;

	public Path(Point start, Point finish) {
		this.start = start;
		this.finish = finish;
	}

	public Point getState(Double time) {
		Integer locationOnXAxis = Double.valueOf(
				start.differenceInX(finish)*time)
				.intValue();
		Integer locationOnYAxis = Double.valueOf(
				start.differenceInY(finish)*time)
				.intValue();
		return new Point(locationOnXAxis,locationOnYAxis);
	}

	public String toString() {
		return new StringBuffer("Start: ")
			.append(start.toString())
			.append(", Finish: ")
			.append(finish.toString())
			.toString();
	}
}
